#include <iostream>
#include <ctime>
#include <unistd.h>
#include "ThreadPool.hpp"
#include "Task.hpp"

int main()
{
    ThreadPool<Task>::GetInstance()->Start(); //创建单例模式的进程池
    srand(time(nullptr));

    while(true) //获取任务
    {
        int oper = rand()%(opers.size());
        int x = rand()%10+1;
        int y = rand()%10+1;
        Task task(opers[oper], x, y);
        ThreadPool<Task>::GetInstance()->Push(task);
        sleep(1);
    }
    
    return 0;
}